import { createRouter, createWebHistory } from 'vue-router'
import Home from '@/views/home/index'
import PlayList from '@/views/home/playlist/playlist'
import Detail from '@/views/home/playlist/detail'
import Player from '@/views/home/songplay/songplay'
import Search  from '@/views/home/search'
import Test from '@/views/tests'
const routes = [{
    path: '/',
    redirect: '/v1/home',
    components: {
        index: Home,
    },
    children: [
        {
            path: '/v1',
            redirect: '/v1/home',
            components: {
                index: Home,
            },
        },
        {
            path: '/v1/home',
            components: {
                index: Home
            },
        }
    ]
}, {
    path: '/v1/playlist',
    name: 'PlayList',
    components: {
        index: PlayList
    }
}, {
    path: '/v1/playlist/:id',
    name: 'Detail',
    components: {
        index: Detail
    }
}, {
    path: '/player',
    name: 'player',
    components: {
        orther: Player
    }
}, {
    path: '/search',
    name: 'search',
    components: {
        orther: Search
    }
}, {
    path: '/test',
    name: 'test',
    components: {
        orther: Test
    }
}
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router